import { createApp } from "vue";
import App from "./App.vue";
import { LoggerUtil } from "@ys-lib/ts";
import { createRouter } from "./plugin/router";
import "./style/index.css";
import { createPinia } from "pinia";
import { initIconMap } from "@ys-lib/naive-ui";
import { initWebSocket } from "@ys-lib/vue/use";

async function init() {
  // 初始化内部logger
  LoggerUtil.initWindowDebug();
  LoggerUtil._d.enable("*");

  //初始化图标
  initIconMap();
  initWebSocket({
    url: "ws://127.0.0.1:10100/ws",
  });

  const app = createApp(App);

  app.use(createRouter());
  app.use(createPinia());

  app.mount("#app");
}

init();
